package com.originskyseed.platform.cms.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.originskyseed.platform.cms.model.CmsContent;

/**
 * 内容正文Mapper类
 * 
 * @author LiangMingHui
 *
 */
public interface CmsContentMapper {

	/**
	 * deleteByPrimaryKey
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public int deleteByPrimaryKey(String id) throws Exception;

	/**
	 * deleteByPrimaryKeys
	 * 
	 * @param ids
	 * @return
	 * @throws Exception
	 */
	public int deleteByPrimaryKeys(List<String> ids) throws Exception;

	/**
	 * insert
	 * 
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int insert(CmsContent record) throws Exception;

	/**
	 * insertSelective
	 * 
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int insertSelective(CmsContent record) throws Exception;

	/**
	 * selectByPrimaryKey
	 * 
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public CmsContent selectByPrimaryKey(String id) throws Exception;

	/**
	 * updateByPrimaryKeySelective
	 * 
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int updateByPrimaryKeySelective(CmsContent record) throws Exception;

	/**
	 * updateByPrimaryKey
	 * 
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public int updateByPrimaryKey(CmsContent record) throws Exception;

	/**
	 * 查询来源ID是否存在引用
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public Boolean existSource(Map<String, Object> params) throws Exception;

	/**
	 * 分页查询回收站列表
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public List<CmsContent> selectCmsRecycleBinListByPage(Map<String, Object> params) throws Exception;

	/**
	 * 批量还原
	 * 
	 * @param ids
	 * @return
	 * @throws Exception
	 */
	public int RecycleByPrimaryKeys(List<String> ids) throws Exception;

	/**
	 * selectByCatelogId
	 *
	 * @param catalogId
	 * @return
	 * @throws Exception
	 */
	public List<CmsContent> selectByCatalogId(String catalogId) throws Exception;

	/**
	 * 分页查询消息审核目录
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public List<CmsContent> selectAuditListByPage(Map<String, Object> params) throws Exception;

	/**
	 * 查询消息列表
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public List<CmsContent> selectList(Map<String, Object> params) throws Exception;

	/**
	 * 根据创建时间和修改时间查询
	 * 
	 * @param time
	 * @return
	 * @throws Exception
	 */
	public List<CmsContent> selectCmsByTime(@Param("time") String time) throws Exception;

	/**
	 * 分页查询消息列表
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public List<CmsContent> selectListByPage(Map<String, Object> params) throws Exception;

	/**
	 * 批量改为删除状态
	 * 
	 * @param ids
	 * @return
	 * @throws Exception
	 */
	public int stateDelByPrimaryKeys(List<String> ids) throws Exception;

	/**
	 * 查找最大置顶值
	 * 
	 * @return
	 * @throws Exception
	 */
	public Integer selectMaxTopValue() throws Exception;

	/**
	 * 判断是否是草稿
	 */
	public Boolean exitDraft(Map<String, Object> map) throws Exception;

	/**
	 * 查询所有内容
	 * 
	 * @return
	 * @throws Exception
	 */
	public List<CmsContent> selectAll() throws Exception;

	/**
	 * 修改同级目录下其他的为不置顶
	 * 
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public Integer updateNotIsTop(CmsContent record) throws Exception;

	/**
	 * 查询当前目录在置顶
	 * 
	 * @param record
	 * @return
	 * @throws Exception
	 */
	public List<CmsContent> selectIsTop(CmsContent record) throws Exception;

	/**
	 * 分页查询最新消息列表
	 *
	 * @param params
	 * @return
	 * @throws Exception
	 */
	public List<CmsContent> selectListNewInfoByPage(Map<String, Object> params) throws Exception;
}